﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using Storm.CodeCompletion;

namespace AutumnEngine.Editor
{
    public partial class ScriptEditor : Form
    {
        private CodeCompletion codeCompletion;
        List<GListBoxItem> auto = new List<GListBoxItem>();
        public ScriptEditor()
        {
            InitializeComponent();
            AddAutoComplete();

        }

        private void ScriptEditor_Load(object sender, EventArgs e)
        {
            //////
            this.syntaxDocument1.SyntaxFile = "Files/CSharp.vsx";
        }

        void AddAutoComplete()
        {

            //Wire up code completion

            codeCompletion = new CodeCompletion(textEditor1);
            codeCompletion.ImageList = this.imageList1;
            codeCompletion.Parent = this;
            codeCompletion.Enabled = true;
            codeCompletion.Visible = true;

            Controls.Add(codeCompletion);


            GListBoxItem item = new GListBoxItem("Cos", 0, MemberType.Normal,
                "Math native used for calculating the Cos value of a value",
                "constant native Cos takes real x returns real");
            auto.Add(item);
            codeCompletion.AddMemberItem(item, true);

            codeCompletion.SortAlphabetically();

            codeCompletion.DisplayList = auto;
            codeCompletion.ListDisplay = ListDisplay.Special;
        }
    }
}
